package ui;

import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;

class StartButton extends JButton implements MouseListener {
	private static final long serialVersionUID = 1L;
	
	private GameGUI gameGUI;

	public StartButton(GameGUI gui) {
		gameGUI = gui;
		setIcon(new ImageIcon(InterfaceSprite.getImage(InterfaceElement.START_BUTTON)));
		setBorder(BorderFactory.createEmptyBorder());
		//setContentAreaFilled(false);
		addMouseListener(this);
		setAlignmentX(Component.CENTER_ALIGNMENT);
	}

	public void mouseEntered(MouseEvent e) {
		setIcon(new ImageIcon(InterfaceSprite.getImage(InterfaceElement.START_BUTTON_HIGHLIGHT)));
	}
	public void mouseExited(MouseEvent e) {
		setIcon(new ImageIcon(InterfaceSprite.getImage(InterfaceElement.START_BUTTON)));
	}
	
	public void mouseReleased(MouseEvent e) {
		gameGUI.showGame();
	}

	//not needed
	public void mousePressed(MouseEvent e) {

	}
	public void mouseClicked(MouseEvent e) {

	}
	

}
